package com.example.demo.day0301;

import java.io.*;

public class DemoSyetemIn {
    public static void main(String[] args) {
        try {
            DemoSyetemIn.testDemoSyetemIn();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public  static void testDemoSyetemIn() throws Exception {//标准输入流
        InputStreamReader is = new InputStreamReader(System.in);
        //创建一个键盘输入数据的输入流

        BufferedReader br = new BufferedReader(is);
        //把输入流放入缓冲流中

        String str = "";//定义一个临时接受数据的字符串

        while((str = br.readLine()) != null){//读完字符串之后，读取不到字符就会返回null
            System.out.println(str);
        }
        br.close();
        is.close();//先开后关

    }

}
